﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="connexion.aspx.cs" Inherits="CPETwit.Web.Pages.MaPage" %>

<!DOCTYPE html>
<html>
<head>
    <title>CPE Meet - Inscription / Connexion</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="res/css/t1_core_logged_out.bundle.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="res/css/t1_more.bundle.css" type="text/css" media="screen" />
    <script type="text/javascript" src="res/js/head_logged_out.js"></script>
</head>
<%@ Import Namespace="CPETwit.Data.Entity" %>
<% 
    /* Traitement du design
     * Sexe masculin => design bleu, 
     * féminin => design rose 
     */
    String _sexe = "";
    foreach (var item in Session.Keys)
    {
        if (String.Equals(item, "login"))
        {
            _sexe = ((User)Session["login"]).sex;
            break;
        }
    }
    switch (_sexe)
    {
        case "M" : 
            Response.Write("<body class='body-male'>");
            break;
        case "F" : 
            Response.Write("<body class='body-female'>");
            break;
        default :
            Random r = new Random();
            int nb = r.Next();
            switch (nb % 2)
            {
                case 0:
                    Response.Write("<body class='body-male'>");
                    break;
                case 1:
                    Response.Write("<body class='body-female'>");
                    break;
            }
            break;
    }
    %>
    <div id="doc">
        <div class="topbar js-topbar">
            <div id="banners" class="js-banners">
            </div>
            <div class="global-nav" data-section-term="top_nav">
                <div class="global-nav-inner">
                    <div class="container">
                        <ul class="nav js-global-actions">
                            <li class="home" data-global-action="t1home"><a href="/"><span><i class="nav-home-logged-out">
                            </i></span></a></li>
                        </ul>
                        <div class="pull-right">
                            <form class="form-search js-search-form  " action="/search" autocomplete="off" id="global-nav-search">
                            <span class="search-icon js-search-action"><i class="nav-search"></i></span>
                            <input class="search-input" type="text" id="search-query" placeholder="Rechercher"
                                name="q">
                            <div class="dropdown-menu dropdown-menu-dark typeahead js-global-nav-dropdown">
                            </div>
                            </form>
                        </div>
                        <a class="close-all-tweets js-close-all-tweets" href="#" title="Fermer tous les Tweets ouverts">
                            <i class="nav-breaker"></i></a>
                    </div>
                </div>
            </div>
            <div class="alert-messages" id="message-drawer">
            </div>
        </div>
        <div id="page-outer">
            <div class="front-container" id="front-container">
                <noscript>
                    <div class="front-no-js-warn">
                        <h3>
                            CPE Tweet fait un usage intensif de JavaScript</h3>
                        <p>
                            Si vous ne pouvez pas l'activer dans les préférences de votre navigateur, vous pourriez
                            avoir une meilleure expérience sur notre site internet via PC.
                        </p>
                    </div>
                </noscript>
                <div class="front-card">
                    <div class="front-welcome">
                        <div class="front-welcome-text">
                            <h1>
                                Bienvenue sur CPE Meet.</h1>
                            <p>
                                Découvrez ce qu'il se passe, en ce moment, avec les camarades qui vous tiennent
                                à coeur.
                            </p>
                        </div>
                    </div>
                    <div class="front-signin js-front-signin">
                        <form id="sign" runat="server" class="signin" method="post">
                        <div class="placeholding-input username">
                            <asp:TextBox ID="UserNameSignin" runat="server" CssClass="text-input"></asp:TextBox>
                            <span class="placeholder">Pseudo</span>
                        </div>
                        <table class="flex-table password-signin">
                            <tbody>
                                <tr>
                                    <td class="flex-table-primary">
                                        <div class="placeholding-input password flex-table-form">
                                            <asp:TextBox ID="PasswordSignin" runat="server" TextMode="Password" CssClass="text-input flex-table-input"></asp:TextBox>
                                            <span class="placeholder">Mot de passe</span>
                                        </div>
                                    </td>
                                    <td class="flex-table-secondary">
                                        <asp:Button ID="SigninButton" runat="server" CommandName="Login" Text="Se connecter"
                                            ValidationGroup="Login" CssClass="submit btn primary-btn flex-table-btn js-submit"
                                            OnClick="LoginButton_Click" />
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="remember-forgot">
							<label class="remember">
                                <asp:Label runat="server" CssClass="remember" ID="ErrorSignin"></asp:Label>
							</label>
						</div>
                    </div>
                    <div class="front-signup js-front-signup">
                        <h2>
                            <strong>Nouveau sur le Meet ?</strong> Inscrivez-vous</h2>
                        <div class="placeholding-input">
                            <asp:TextBox ID="UserNameSignup" runat="server" CssClass="text-input"></asp:TextBox>
                            <span class="placeholder">Pseudo</span>
                        </div>
                        <div class="placeholding-input">
                            <asp:TextBox ID="EmailSignup" runat="server" CssClass="text-input"></asp:TextBox>
                            <span class="placeholder">Adresse e-mail</span>
                        </div>
                        <div class="placeholding-input">
                            <asp:TextBox ID="PasswordSignup" runat="server" TextMode="Password" CssClass="text-input"></asp:TextBox>
                            <span class="placeholder">Mot de passe</span>
                        </div>
                        <div class="separator error-signup">
                            <asp:Label runat="server" ID="ErrorSignup"></asp:Label>
                        </div>
                        <asp:Button ID="SignupButton" runat="server" CommandName="Login" Text="S'inscrire"
                            ValidationGroup="Login" CssClass="btn signup-btn" OnClick="SignupButton_Click" />
                        </form>
                    </div>
                </div>
                <div class="footer inline-list">
                    <ul>
                        <li><a href="apropos.aspx">A propos</a><span class="dot divider"> &middot;</span> </li>
                        <li><span class="copyright">&copy; 2012 CPE Meet</span> </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="res/js/foot_logged_out.js"></script>
</body>
</html>
